Repository navigation
Conversation
Collaborator
|
Thank you @SoroushRF for your contribution! 🎉 Your changes have been successfully imported and merged via Copybara in commit 531f410. Closing this PR as the changes are now in the main branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
Problem:
When a restored resumable invocation contains parallel calls to the same tool, one ID-less response currently marks all calls with that name as answered. The flow can therefore continue without executing an unmatched sibling. This is separate from the original #7108 fix, which already landed.
Solution:
Count ID-less responses per tool name. Match explicit response IDs first, then consume one name-only response per remaining call in original call order. Filter the replay event by content part so calls without IDs can also be distinguished by their position. Preserve non-call parts and stored events.
The existing agent-authored batch-completion guard, pause/LRO/HITL decisions, branch filtering, and author provenance checks remain unchanged. The helper docstring documents the matching rule; no public API or configuration changes are introduced.
Name-only responses cannot identify which same-name arguments actually ran. Call order is a deterministic compatibility fallback, not an exactly-once guarantee. Normal ADK responses retain call IDs; this fix concerns restored or caller-supplied histories with ID-less responses.
Testing Plan
Unit Tests:
Validated commit
d3fc9d13d39137351be2b25763239c8c5d560389:pytest tests/unittests -n 2 --junitxml=test-results.xml:All five jobs succeeded with zero JUnit failures/errors. The logs include warnings, including aiosqlite worker-thread shutdown warnings in session tests. The validation workflow and generated dependency lock are on a separate fork branch, outside this three-file PR.
git diff --checkpassed. Strict mypy reports 809 diagnostics on both pristine main and the patch, with zero new diagnostics after comparing diagnostic multiplicity with line numbers normalized.The tests cover response multiplicity, sufficient/extra responses, explicit-ID priority in both response orders, duplicate/unmatched explicit responses, missing call IDs, content order, immutable history, and the batch-completion guard. Flow regressions verify exactly which tools execute and which response IDs are emitted.
Manual End-to-End (E2E) Tests:
Save the offline Runner reproduction from #7387 as
resume_smoke.py, install this checkout (uv sync), and runuv run python resume_smoke.py. It restoresask/c1andask/c2calls with different arguments and one user-authored ID-lessaskresponse, then resumes the saved invocation. The Runner, in-memory session service, and counting tools are real; the model boundary is a deterministic local implementation. No external model requests or paid services are used. The before result below was reproduced on pristine maine94c2e72; the after result uses the reviewed commit.Built the wheel and source distribution with
uv build. Installed the wheel in a clean environment and reran the same reproduction from outside the checkout: passed, with imports coming from the wheel installation.Checklist
Additional context
Prepared with AI assistance under contributor direction. The original edge case and diagnosis are credited to the linked issue discussion. A separate source audit found no actionable defects in the patch. No downstream documentation changes are needed: this correction changes no public API, configuration, or documented setup workflow.